package asteroids.model.programs.parsing.expressions;

import java.util.List;
import java.util.Map;

import be.kuleuven.cs.som.annotate.Basic;

import asteroids.model.programs.parsing.types.Type;

/**
 * A class of unary expressions.
 * A unary expression involves a single operator applied to only one operand.
 * 
 * @author Thijs Dieltjens - Wim Konings
 * @version 2.0
 */
public abstract class UnOpExpr extends Expression {

	public UnOpExpr(Expression expr,int line, int column) {
		super(line, column);
		this.operand=expr;
	}

	@Basic
	public Expression getOperand() {
		return operand;
	}

	private Expression operand;

	@Override
	public  List<String> getTypeCheckErrors(List<String> errors, Map<String, Type> globals) {
		return getOperand().getTypeCheckErrors(errors, globals);
	}
}
